Made calculations more flexible