main update, calculate distance fix, classifier still have errrors