rewrite the build amp function

now computes relatedness page-by-page instead of chunks (this is the correct method)