HW4:task1: solved memory leak in main()