Adding (untested) scanForObjects function