changed hash method implementation