still need to test rule2 and have corresponding output function for it