Added function detectCity()