removed determineDX from loop