solving defining classes 1 homework