fixing bugs, removing excess print statements