Added rule and goal check functions