Now checks args validity. Also reintroduced the header comment from earlier.