changed data reset methods from a for loop to memset()