restructured and other fixes