replace .has_key() with 'in' statements.