updated and commented