changing checkNotNull() to use IllegalArgumentException rather than NPE, and cleaning up comments