updated arduino sketch