added extra digitalread(), seems to fix a lot of problems