Made the server more simplified and added better comments