Added most of the code, PAGE_SIZE issue still pending