added scan function documentation