comments added
HW4 program in one file