modified to compile on arduino due