changed to d in elif loop