Fixed issue in how Y's treated throughout functions