fixed most errors with the rehashing