checking bugs and hash code function