finaly made printf work; very ugly but works