Initial version with original authors' code unchanged.