Slightly refactored Step 3