implementing the popup function (have not done yet)