## NOTES This is not perfect, but seems to work for a the tests I've run against it.