Software Design visitor patterns homework