Updated Contract for tip function