cleaned up sender code, removed magic numbers