functionized getLocation