Adding some extra code

Adding flush to the write portions of the packets.
Changing cremove to cdelete
Removing some un needed code