When creating a zigzag stitch, the back-and-forth motion of the sewing machine's needle is controlled by a cam. As the cam rotates, a fingerlike follower, connected to the needle bar, rides along the cam and tracks its indentations. As the follower moves in and out, the needle bar is moved from side to side. Very old sewing machines lack this hardware and so cannot natively produce a zigzag stitch, but there are often shank-driven attachments available which enable them to do so.