0.2: make "value" a private val, and pass it to close() as an argument instead