changed clearAllMemory to call a function called clearPartition, which
clears a memory partition. Trying to modularize some code out of memory.