return value correctly calculated