finalized arduino code as a library