re-edited code