done index, dependency between pages and fixed some bugs.