added ability to snap horizontally and corresponding demo