added conditions test case. added average func to conditions