basic solve implementation