Main while loop cleaned up
Merge http://github.com/dlpeatman/Operating-Systems