roughing in popup view code, works but needs to be refactored