reformatted javascript