explicit terminal definition added
Added checking if files exist
Tweaking