Added a first implementation of t5he write method