Finished basic functionality of popup