modify as trvis suggested