improvements, more tests