simpler javascript