fixed negative detection and added yard doc