added jquery functions and fixed stuff