fix calculations