js improvement. first off then on