Closes server socket when the program is shut down.
Adds support for grading option