method for finding flat areas works well. Got some strange assert
failures on binning errors..