working but messy, need to clean up the ripped raw socket code.