Reversed the parameter order of the extract function
Added handling for autoincrements