Cleaned up the code and layout

I have cleaned up the layout and made the code cleaner