added Rule Chain and improved engine