Implemented getLocation method.