backtracking funcional CTM

Signed-off-by: Victor Gonzalez <victor.gonzalezro@gmail.com>