fixed factor calcs where the ttm values were negative. we now set the factor value to nil instead of zero.

also changed the distance method to handle nil factors properly.