add array copy algorithm