More improvements on swissTM algorithm, not functional yet. Work in progress.