Added media and fixed so that the functionality is correct when buttons are clicked.