Substituted '!== -1' for '>= 0' and '-= 1' for '--' in for loops.