doing things better  w/ javascript