Use a function to get ttn