Basic code for CNN