first stab at having popup position itself. needs to be modularized and made flexible.