Added ability to update location
added tests and refactored