added snap behaviour