added formula for lua