use copyOfRange