working version of homework obj 1