lots of work

basically rebuilt the layout and made the js smarter