Made the code that builds the array a bit cleaner.