insert solution into database