modified library and add examples