fixed up logic of order types, added tests (which pass :)