adding library, fixing bug