Made isEqual snippet more standardized

Also added hash method to snippet