functions copy and find_replace