javascript final edit