Added a recursive copy function.

Yeah, I know it's not the best.