Added separate method to figure out memory usage