help me vectorize this | ScratchStats