Fix for miscalculation