Added generic scan method