rename 'm' to 't' and make it generic