got the dist sematics function working