Updated arduino code