Seems to be working, but very inefficient.