added a (basic) snap to center behaviour