Less problematic and more correct receiver implementation; I fear I may have screwed something up though