Implementing Pipelining in main