rearranged js