Change number of cores and add code for flash rom