First code commit; working but with some deviation from the MemoryStream experience