added a switch and some documentation