fixed bug one of the book psuedo code