add comments here; this stuff will be hard to read for anyone not intimately familiar with `np` magic