added pipeline, split script into _run file from functions/classes etc