reformat comments
add docstring to as_dummy()