better offset detection for scrollspy // cleanup