more reordering, adjusted tests, integrated unit tests