Untangle move_packet, enforce structured programming