added timeout functions , comments and a few fixes

unknown revision '-1'