restructured and added update_effect()