close to final
style changes and some useful adjustments