added library and fixed register