Koepel - I have modified the code to most of your recommendations. The delay in the master loop was particularly useful info as when I programmed up 2 real boards, instead of using the simulation program I had been using, it wouldn't work without the delay. I have now incorporated the I2C part into the main project and it's all working fine.
So, thanks again to all who've helped me, I would never have done it without your help.