Finally fixed formula