The determination of vector magnetic fields from stokes profiles