Use copy() instead of for loops where appropriate.