Correct gamma function
Casted 0.5(no-1) as double