many small changes, closed issue 6