I wrote this program to help someone else and as a learning exercise but now I am confused as to why the strange additions are happening? Help is greatly appreciated