solved defining classes homework