added shutdown method, and made some existing methods private