added printf functionality