implementing reverse magic