Improved and integrated clustering algorithm