Update #4

Fixed some mistakes in the code.