removed debug stuff and better networking