attempt to add in long poll
did some refactoring
more refactoring