refactored listenForUDP

needs testing