New output with jquery + one step closer to generating better html + bug fix