Implemented references and pointers instead of call by value cases in writer.