This code now works - Forgot to add ready threads to ready list.
Removed unnecessary code.