implemented stage processing