Updated with explanations and an example.