Answer:
Having tested your source code, I realize that there is nothing to be added or removed from the source code you uploaded as your program works perfectly.
However, I've rearranged properly the lines of the program you uploaded.
See attachment
Explanation:
See Explanation