Added a more dynamic way to figure out what display mode to use