Added support for PageCount.
Refactored program.cs.
Refactored program.cs.