many minor modifications