finished video 30: Implementing the closeConnection Function