Corrected mistake.
Corrected mistake (did not account for reversed logic).