changed runQuery to not close the connection, added closeConnection, modified all methods which use runQuery.