added logging in main
fixed client and server, they are now ready to get merged with master