started on client; need to fill in switch statement for server