program complete and commented