The code looks good to me, but the `toArray(ns)` line is repeated each time. Can you factor it out?