Here's a better version with more explicit comments about somedetails. It passes on CI. Planning to push this soon.