Clean up and simplify code to find marks before and after a position, and hence impro...