added window snapping