Cleaned up some code and added shutdown to both processes instead of just the keyboard related process