Added optional argument for iterations count