testing, refactor, corrected indexing issue with packet parsing