chnaging passing value into pointer for unitVector and myDistance