Cleaned up arduino code