Copied MySolver.java from lab1