many improvements and began with cython to speed up gpio access