Add couple of helper function from the book