Updated for new data structures