implemented opening other files correctly