modifications suggested by vrabaud