Refined and tested code - takeaway: - 1 Buffer node needed