Implementation of getLocation