Added mtemplate.c
Clean up mtemplate.c. Should compile now.