added single-pass clustering