added license and fixed average page issues