more robust server and cleaned up other files