smarter Y coordinate generation