Added iterations to optimize and modified some parameters