initial working version
Add better documentation