added basic system for selecting how you want the popup to layout around the cursor