calling forward and backward chaining