snap_in: dramatically improved style of snap_in by using lookup array instead of copy/paste. Fixed a number of bugs in snap_in and snap_filter as result