update reshape logic