increased the depth limit
converted execution to loop-based instead of recursive
making tester stop and output best fit if runtime error occurs