added some test to rules
added functions to test