add code to switch on input extension