changes to Solver to abort if search is too long
added javadoc