The amount to determine should NOT include the unemployment. If I have $38K in earned income

The AGI is used to qualify. The earned income (not including unemployment) is found on the table in pub 596. Your software calculation is incorrect.