adding detection of an existing line
pretty sure I can call this one a beta release
cleaned up a bunch of syntax and reorganized logic
there were some edge cases that needed to be addressed

This currently works for all use cases that I could think of