move some functions to utils.go
calc_blr()