Added up to date code for client and server