Code for final project of Comp 561