first writing of borrow book function