Cleaning Up Code

Updated code for #10
Still needs to be tested.