Added code for runtime selection at execution time