Eliminate global d, and improve help.