Using Array.fill now to avoid iterating twice