Fixed a repeat bug
Added some documentation