changed page-finding function to be platform agnostic