More improvements on SwissTM algorithm, still not functional. Work in progress