hopefully completed solver