Fixing calculate differences