— The problem of simultaneous localization and mapping has received much attention over the last years. Especially large scale environments, where the robot trajectory loops back on itself, are a challenge. In this paper we introduce a new solution to this problem of closing the loop. Our algorithm is EM-based, but differs from previous work. The key is a probability distribution over partitions of feature tracks that is determined in the E-step, based on the current estimate of the motion. This virtual structure is then used in the M-step to obtain a better estimate for the motion. We demonstrate the success of our algorithm in experiments on real laser data.