changed showResult function