Added Ace calculate function