js rearranged