Some really ugly code for UDP handling, but other than Logging everything is working