Updated to work with latest Arduino