minor
faster, overlaping
better
vectorize; now seg and tag are the same, haha
faster with numpy arrays