initial code for server