Made solving more efficient