Add arduino code and some clean up