added page java doc, added some comments. little refactor.