Fixed Bug with yArray calculation