faster methods to write array.  started on fireball code