fix requirement functions and fix examples to use them