Started work for calculating page number and offset