Added pipeline architecture code. Main entry point still untouched.