Implemented Page class to clean up code. Probably needs more refining or at least divide viewing and logic.