fixed crossbrowser calc