wrapped TeslaCommand program in a function