Added hashCode() method.
Used Double.compare in both compareTo() and equals() methods