why this function? You only use it for two values? Rather add it directly to calculateTtl(), no?