adapted to new data structure