modified javascript bug, separated files and more formatting....