js moved from index to stand alone