A two-step iterative procedure for clustering of binary sequences