cleanup, fixed bug : stopping after an array index was found