Adapted to final version