add poll routine
completed poll threading code