added ability to change num iterations in grad descent