Phew! it works now. Figured out how to use streams, still not doing it properly though but wrapped my brain around the basics.