Adapted to new settings