Changed getLocation funtion to do all lookups