Added code for clsutering