adding the functionality from former script. Also added documentation
introducing 'mandatory' arguments