added tests
added tests, improved handling of unassigned