added snap, lots of bug fixes