fixed the errors pointed out by Ivan in the following email: