Added constant for max iterations

made some ints to unsigned int