fixed up the flashy parts of the js