Added code for finding and replacing ${variables}