reverted back to the old trapezoidal sketch algorithm