added code for managing packets and parameters