improve file existance checks, comments