Expanded the documentation and commenting