Updated the memory check so it's less taxing