code reshape before merge back to master.