Adding documentation and cleaning up syntax.