fixes issue with marker text width, corrects bad var paths, adds some local vars, and forces distance text to be under labels