Attemt to calc approximation not working correctly