blog, video 29, Implementing the openConnection function

implemented code inside the openConnection function and commented
blog, video 30, Implementing the closeConnection function

implemented code into the closeConnection function and commented