Add new exec() function and document it