functional and commented script