modified filling script