added special compare function to take into account floating point differences