add pages to index and methods to DB class.