Deadline Algorithm Changed

Improved the algorithm for deadline assignment and re-factored
substantial amounts of code.