Added header for compatibility with all versions of Arduino and renamed some variables to more logical names.