added location function