improved documentation and added examples