completed solver class
fixed some small bugs