Added unit definition for dirOffset and modified usage to reflect
Fixed float problem in dirOffset calculation