Added memory option to help with large graphs.