fix vertical ribbon calculation