javascript first pass