Finished the pages method(without comments).