create utils.scala
can calculate xi and gamma