Optimized the program