functions for comparing two values