Refactor the file exists check
Adding gamma implementation