Updated documentation and did a little bit more optimization.