Added javascript header and removed unused things.