add function prototypes to headers, move function implementations to cpp files
add counting of number of pages at each distance