introduced double comparator with precision for testing