removed redundant assignment from outside if statement
removed debug prints
added basic finishing criteria
basic test for finishing