Tweaked Distance method

Added support for detecting distance to line - concept by slacky, thank
you!