Added a bunch of documentation and _usage_ function. Also added a check for avoid
null variables.