Uses iterative simulation instead of recursive to avoid recursion limit.
Merge branch 'master' into hw1
Removes unneeded calls to reset().