broadcast code refactor. possibly fixed dupe packet bug