add straight line implementation