worked on popup.js -- tried to make it functional