adapted to new problem structure