rules can be orderer now + added unit tests