Added some code for page discovery. not tested or aynthing.