added the line logic
drew the lines
merge