fixed code of the program