Fixed duplicate code bug
Amended documentation