adding in all the additional code from my arduino code library.