'Pack a sequence' reimplemented