Reimplemented the TLD example with templates
Fixed the initial cleanup
Improved the dimensions adjustment