new js file, minor fixes and improvements