Added quick documentation and optimization.