adds includes, images, functions and lots of fixes