Improved main file