Removed unwanted functions and edited TrimPacket()