snapshot algorithm implemented. second phase debug [start]