added alternate write method