fixed solution finding bug