Insertion of function code