add a 2d line function