removed custom toArray implementations
removed while loop from array