Add doc string and invalid argument check. See #10