Sorted out some stuff, cleaned up the files, hopefully haven't broken anything