Fixed a bug, documentation added