made relative comparison of values functional