cleaned up dilution code and added g_gpu_flag