Imported inital MaceTech code