Added code for page mapping and frame allocation