Cleaned up code; added serverside skeleton for client