add more functions from the book