adding functions and pages