simplified recursive solver and changed solve function so that it marks the successful path once the maze is solved