updated gamma function to be more accurate approximation