More appropriate for the solve function to be a loop