Pseudo code for client and server