changed scan method again.