reduced the memory usage by not storing everything in hash variables but it now runs slower