Added ability to backtrack