updated program to work with file changes