almost finished terminal part