Pulls out swap functions. Implements applying steps to puzzle