fixed metric calculations and more rtl stuff