implemented various suggestions by Henry