Adding [] for string a max loop in while and for and i++ in fors