got the display working while calling the function display() not main()