setting up distances