Updating to work with latest code