added set for array list
created toArray and toArrayCopy functions