updated pollForMotion.py