finalized import function