Solve bugs and added new library