Implemented dynamic program selecting in index