javascript code improvements
new ui
make use of jquery.each for loop