rearanged a few more things after finding more js troubles