added some page size math to mem_init, still not working in case when sizeofregion is not divisible by page size