working version of cluster_em, no em though...., not yet...