put function for unused JS back in and cleaned up a bit