complete the addbook function