Added clustering functionality