simple 2d version of bezier code