switched port to 8000
added missing breaks from switch-case, and simplified code
did terrible things to this code, sorry joe