Update code and add example usage