Implementation for MySolver, but not working yet.