Added indents.
Changed measureLength() to calcLength()
Changes for SSH2 support.