complete auto assign core logic