added some location code