added popup and everything (see previous commits)