how to code a scaffold with packet rotations?