repurchase packets to be printed

updated sql