Structural changes

Added comment and Structured the code. Page title has been inserted
while adding new pages.