Added semaphores, message queues. I think. Added some logic to the input management code.