Fixed redundant calculation.