Add location function