Here's a detailed explanation: