Tidied Code + Added Dynamic Sizing