using Array.map now, but the scanPage() function is still broke