added doc libraries and fixed some bug