Created by: hixi
only drawback: no estimation of the pbf size in case of failure.
@das-g please review