lots of refactoring and delete snap functionality
improved diff