fixes issue where 0 is not being recorded as a value. simplified logic too.