implementing the compare parser