added some cringeworthy javascript