tidied up docs and simplified some bits