revised version, and cleaned up snapshot