modularized. Have both server and client working