updated stata code