Fixed nucdiv dxy function