Removed writelns, clear packets after processing.