Updated main.min.js with recursive func