Code to do feature alignment in dig