inheritance and little condition statement