adding logs for debugging, simplifies handshaking states
handshaking - removes state transition logic from states
fixes bug in test and some logs added