cleaned up IndexScan and added test