corrected indent to kw argument
renamed internal print > _print to simplify interface
deal with empty arrays better
modest performance improvments, now only 1.2-1.3 x slower than before