fixes ratio calculation