-slight refactor of mutation
-fixed bugs with undx