function(DM)
{
	for(i in 1:nrow(DM)) {
		j <- 1
		test <- 0
		while(j <= ncol(DM)) {
			if(DM[i, j] == 1) {
				if(test == 1)
				  DM[i, j] <- 0
				test <- 1
				j <- j + 1
			}
			else {
				test <- 0
				j <- j + 1
			}
		}
	}
	return(DM)
}
