Protocol now working except edge case toward the end, where extra packets beyond filesize are sent