Added tweaks and documentation to previous pull request