various changes and more tests