cleaned up a bit, popup still not updating properly though