cleaned server.R