improvements; almost all tests