Updated to more closely match original problem