Tested new js and added a function to clean up.