added beta and gamma computation