clean up and syntax/doc improvements