optimized arduino code and the reader library