add display in solve function