Implmented sliding window technique I believe. Next step is to add in timeout feature.
Cleaned up merge conflicts