optimized debug mgs