Added Memory count functionality.