Update to data choosing code to work in all situations