Created findValidLines method to accept user input. Converted findValidLines to use sets for dedup.