Tidied up tabs and add JSDoc