[OLD] figuring out this algorithm | ScratchStats