applying gary's changes