Added more messages, and condensed and trimmed down handshake code