Changed all integers to unsigned longs - atmega2560 use 16 bit integers