implemented most of the corrections