assignment working (no derived classes)