updated with jens's current version of snap v2