wrote a method to calculate stops on a single line