Implemented the stack function. Nextup, merge Jacob's packet implementation