better array clearing via memset

Now uses memset, a gcc optimized way to clear arrays vs the for loop implementation.