Attempt 2 to fix equation