forgot the line algorithm