Add function copying
Whole bunch of new functions