implementing debug_trace and fixing grade script