add some cache optimisations, clean up file format & typos [faux123]