readPwi improved, writePwi implemented