Arrays and strings with while loops