This is so inelegant I can't tell if it's accurate or not. ...On the other hand, I can't solve it myself.