documentation and argument checking