Fixes #25 - Implement handshaking