revamped location code finding