Space curves and solitons of the KP hierarchy