Final changes to all functions