Can you explain how the first one works line-by-line.