fixed jQuery

and other small changes in the structure