Better snapshot algorithm.