is there a way to avoid these lists with a pure numpy solution?