sliding window is almost working!! it's just crashing on the last
packet :DDDDD