updated *.m to handle trivial cases