Refactored Driver

Got rid of repetitive code, added some documentation
Added trace file with one instance of deadlock