Updated to store and return the whole location object