Rearranged some code. Working on fixing the crash when the stack extends off of the main window.
Fixed a bug in the selection state and cleaned up the time formatting