added lgamma function in math to call Boost version
fixed uses of lgamma to use Boost lgamma, cleaned up formatting and tabs