setting up location logic