Added main and mem_available method