moved to self calling function, removed monkey patching of Array prototype