working teo, working template extraction, interval controll still pending.