improved the new layers of generate min value