Detection of runs, removing runs, removing rings