Implemented run queues.
Added checks for erroneous input