New version with recursive expressions