Edited the main code

Edited the main code gotten from internet to adapt to my program and
added the background images