upload legacy m code