add more docs and examples. fix broken case statement