changed the function that retrieves a single location to decide what to get based on the variable type, so it doesn't need to be two seperate functions