added clustering for each separate type

Added clustering by type