Initial working version of cluster assignment