Correct latex and main DM code
Remove unnecessary files