changed distance measurements + bug fixes