Updated.
Original authors' code.