updated js script

got rid of pointless functions