code cleanup and fixed false negatives