move tests under showResult function