Change to a smarter way to fill the array