removed some unneccessary distance calculations, fixed model2