add toString method for solver