Updated to include use of close().