implemented hasCode and toString