some long overdue changes
tests are fixed