structure code better and move to require js so I don't have to write loads of script tags zzzzz