more counter stuff and further updated arduino code