Huge Javascript update