made javascript external;merged update_book with book