more improvements. almost final