refactored code
added location query configuration
fixed a bunch of things haha