better function comparion