this works
it's a kludgey mess, but we can fix that tomorrow