Implemented function to checkout books