added dereddening and deredshifting functions