replaced lstat() with stat(), program no longer identifies symlinks