modified javascript amazing1 blog