tweaked arduino code