Implemented proper mutation function for the TSM