fix reshape, populate variables