Create subfunction 7