added logic to handle the operators and value lists