Add doc string and invalid argument check. See #10

See #10