lab10 edit, used other method