A Step-by-step Introduction to the Implementation of Automatic Differentiation