This snippet compares different values and returns required chunk or string.