refine code to switch to external music file