Correct code for new data structure