reshape and draw functions