Genrate and scan