Sandboxing and comments

The function 'sandbox' separates the user's variables from clashing with
the existing ones. Which means better security and less odd behaviours.

I also wrote some comments for a better explanation what's going on.