modified layout and tightened up some code