working towards a functioning ERN.write