from scanner to readwriter