kludgy, but it works.