Add Libs on dist

Some modifications and optimization