Modified function to work with new data