scan function added