js changes from Colton's suggestions (thanks Colton)