put in the begginning of done button
doing just in case
refactored both the js and html,putting in more global terms