Moved bitmap gen to function
Functionised some more
nearly all clean and tidy
cleaned up some old files