clculation fixes