Tidyup and documentation.