Added core logic for location