Added exec script (TJ)
Several changes in the code (TJ)