Completely redesigned the popup window

This PR delivers the desired functionality for #21.