Refactored window creation function
Working on redoing the UI