files reorganized in packages and added opening of files function