rewrote pe61 to search for solutions in any order