added collection as script param, more documentation