main script of pipeline