the version before change padding to learning a smaller template