Tutorial basic implementaion, few bug fixes