Removing global variable for using comparator.

By passing hash object parameter to comparator explicitly.