Create mag.cpp