pulled out iterateThroughParameters method