progress on tests
bug fixes