Reformatted the code blocks using code fences.