Added animation and the logic for calculating the tip.