cleaned up docco and a few tiny tweaks