changing structure again and fixing some console errors