Correcting the gamma filter
Grid search code