check for unit
simplify conditional checks to 1s and 0s
unit resets to null; var rename for clarity
move return zero to bottom of method
remove old unit method