modified code to allow for new BASE_LOCATION constant