added some javascript FUNctionality