more compact version of pipelining program